1. Field of the Invention
The present invention relates to a method of comparing a state variable or a packet sequence number for a wireless communications system and related communications device, and more particularly to a method of comparing a state variable or a packet sequence number with modulus arithmetic in an unacknowledged mode of a wireless communications system and related communications device.
2. Description of the Prior Art
The third generation (3G) mobile communications system has adopted a Wideband Code Division Multiple Access (WCDMA) wireless air interface access method for a cellular network. WCDMA can provide high frequency spectrum utilization, universal coverage, and high quality, high speed multimedia data transmission. The WCDMA method also meets all kinds of QoS requirements simultaneously, providing diverse flexible two-way transmission services and better communication quality to reduce transmission interruption rates.
The 3rd Generation Partnership Project (3GPP) sets forth a Radio Link Control (RLC) communications protocol standard for providing different levels of transmission quality with operating modes of Transparent Mode (TM), Unacknowledged Mode (UM), and Acknowledged Mode (AM). TM is appropriate for use in services with high requirements for real-time transmission, UM is appropriate for use in services with requirements for real-time transmission and packet sequencing, and AM is appropriate for use in services with low requirements for real-time transmission, but high requirements for data accuracy.
In UM, an RLC entity of the receiver, generally including reception buffer, remove RLC header, and reassembly entities, receives protocol data unit (PDUs) from a lower layer, namely the physical layer, and then discards or stores the PDUs in the reception buffer according to sequence numbers (SNs) of the PDUs. For realization of the aforementioned RLC operations, the foregoing specification defines a VR(US) state variable containing an SN following the SN of the latest PDU received by the reception buffer. For example, when a PDU with an SN equal to (x) is received by the reception buffer, VR(US) is set equal to (x+1). VR(US) is updated each time the reception buffer receives a PDU. The receiver discards associated service data units (SDUs) included in the PDU if the SN of the PDU is out of sequence.
The 3G mobile communications system also provides Multimedia Broadcast and Multicast Service (MBMS), which transmits service content (e.g., television programs, movies, commercials) from servers to each user equipment (UE) through different cells in Unacknowledged Mode (UM). Each UE may be located under coverage of many different cells. In other words, a UE can receive a same service content from different cells.
In order to have a user equipment (UE) correctly process the service content and take advantage of this multi-route transmission characteristic, the RLC entity of a UMTS receiver as well as the UE are able to initiate a Duplicate Avoidance and Reordering (DAR) function, efficiently combining the PDUs that may be transmitted from different sources (cells) and/or duplicating transmission from a same source to form a single order of a PDU sequence. In this situation, the RLC entity consists of a DAR entity, a reception buffer, a RLC header remove entity and a reassembly entity. After the DAR function is initiated, the RLC entity executes duplicate PDU detecting, discarding and reordering operations according to the SNs of the PDUs. For more detailed description of the operations, please refer to following statements.
To support the Duplicate Avoidance and Reordering Function, state variables and protocol parameters below are defined by the specification of the communications protocol described above:
1. VR(UDR): A state variable representing an SN of a next PDU that is expected to be received in sequence.
2. VR(UDH): A state variable representing an SN of a highest numbered PDU that has been received by the Duplicate Avoidance and Reordering Function.
3. DAR_Window_Size: A parameter indicating a size of a receiving window of the Duplicate Avoidance and Reordering Function.
The RLC entity executes the Duplicate Avoidance and Reordering Function according to V (UDR) and a receiving window of the Duplicate Avoidance and Reordering Function where a receivable range of the receiving window is from (VR(UDH)−DAR_Window_Size+1) to VR(UDH). After initiating the Duplicate Avoidance and Reordering Function, the receiver determines whether a SN of a received PDU lies inside or outside the receiving window and whether the reception buffer stores a PDU having the same SN as that of the received PDU, so as to determine whether the received PDU is duplicated or not. If the SN of the received PDU lies outside the receiving window, the received PDU is stored in the reception buffer, and VR(UDH) is set to be the SN of the received PDU.
For the MBMS of the UMTS in the 3 G communications system, the 3GPP further provides an “out of sequence Service Data Unit (SDU) delivery” function, so that a receiver operating in an Unacknowledged Mode (UM) can more efficiently process the PDUs that are periodically retransmitted by a transmitter. Operating in the Unacknowledged Mode means that even if packets (PDUs) transmitted comprise sequence numbers (SNs), the receiver does not report a receiving status back to the transmitter when it receives or drops a packet. Therefore, in UM, the transmitter cannot positively acknowledge whether packets it has transmitted are successfully received.
To increase a probability that the receiver successfully receives packets, the transmitter can periodically retransmit packets that it has already transmitted, and the MBMS in UM uses the same periodic retransmission mechanism. When the RLC entity of the receiver in UM initiates the out of sequence SDU delivery function, the RLC entity recombines and delivers the SDUs to an upper protocol layer as fast as it can. In other words, even if a PDU with an earlier (lower) SN has not yet been successfully received, as long as a PDU comprising a complete SDU has been successfully received, the RLC entity delivers the complete SDU to the upper layer. In addition, when the out of sequence SDU delivery function is initiated, in order to allow the retransmitted SDUs to be reconstructed effectively by the receiver, the reception buffer of the receiver stores a PDU until all SDUs of the stored PDU have been reconstructed, after which the PDU is deleted from the reception buffer. Other than that, to maintain good receiving efficiency, the prior art deletes PDUs from the reception buffer in accordance with a storage window and a timer.
For the out of sequence SDU delivery function, the specification mentioned above also defines the following state variables and parameters:
1. VR(UOH): A state variable representing a highest of all SNs of all PDUs that have been received;
2. OSD_Window_Size: A parameter representing a size of a storage window; and
3. Timer_OSD: A timer representing a time spent waiting to receive a next PDU. When a PDU is received, the timer is reset. If the timer expires and another PDU has not yet been received, the receiver deletes all PDUs stored in the reception buffer.
According to the specification described above, after the receiver establishes or re-establishes the receiving entity when receiving a first PDU, VR(UOH) is initialized and set to SN−1 based on a SN of the first PDU. If the SN of the PDU received by the receiver is outside of the storage window, meaning that the SN of the PDU is not in a union {x|VR(UOH)>=x>VR(UOH)−OSD_Window_Size}, the state variable VR(UOH) is set to be the SN of the PDU, i.e. VR(UOH)=SN. Additionally, if the timer Timer_OSD expires, the PDUs stored in the reception buffer are deleted.
In the specification, the receiver has to compare the aforementioned state variables or SNs with modulus arithmetic for determining whether the received PDU lies inside or outside the receiving or storage window. Furthermore, the receiver of the prior art uses the VR(US) state variable as a modulus base for all modulus arithmetic in UM. In this situation, when the DAR function or the out of sequence SDU delivery function is in use, using VR(US) inapplicable to the functions as the modulus base causes errors in state variable or SN comparison.